<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>dev: dev::net::TcpAcceptor Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">dev
   &#160;<span id="projectnumber">0.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classdev_1_1net_1_1_tcp_acceptor.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classdev_1_1net_1_1_tcp_acceptor-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">dev::net::TcpAcceptor Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="_tcp_acceptor_8hpp_source.html">TcpAcceptor.hpp</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for dev::net::TcpAcceptor:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classdev_1_1net_1_1_tcp_acceptor.png" usemap="#dev::net::TcpAcceptor_map" alt=""/>
  <map id="dev::net::TcpAcceptor_map" name="dev::net::TcpAcceptor_map">
<area href="classdev_1_1net_1_1_socket_event_handler.html" title="套接字事件处理器 " alt="dev::net::SocketEventHandler" shape="rect" coords="0,56,177,80"/>
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a34699ddc95814ad1ca8ccebc86b0456e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a34699ddc95814ad1ca8ccebc86b0456e"></a>enum &#160;</td><td class="memItemRight" valign="bottom"><b>Status</b> { <b>READY</b> = 1, 
<b>RUNNING</b>, 
<b>EXITING</b>, 
<b>EXIT</b>
 }<tr class="separator:a34699ddc95814ad1ca8ccebc86b0456e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</td></tr>
<tr class="memitem:adf406170ea5e4164ea5b67fc0d2cfe75"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="adf406170ea5e4164ea5b67fc0d2cfe75"></a>
typedef boost::function&lt; TcpConnectionPtr &amp;(sock_t)&gt;&#160;</td><td class="memItemRight" valign="bottom"><b>RtnTcpConnectionPtrRefCB</b></td></tr>
<tr class="separator:adf406170ea5e4164ea5b67fc0d2cfe75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ba04711a4120af7ba46157f8ba122c8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3ba04711a4120af7ba46157f8ba122c8"></a>
typedef boost::function&lt; void(TcpConnectionPtr &amp;)&gt;&#160;</td><td class="memItemRight" valign="bottom"><b>PassTcpConnectionPtrRefCB</b></td></tr>
<tr class="separator:a3ba04711a4120af7ba46157f8ba122c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a3f7e8ab49db7fa4b333430d0cf0f13ce"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_tcp_acceptor.html#a3f7e8ab49db7fa4b333430d0cf0f13ce">open</a> (const char *addr, int port, int backlog)</td></tr>
<tr class="memdesc:a3f7e8ab49db7fa4b333430d0cf0f13ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">打开接收器  <a href="#a3f7e8ab49db7fa4b333430d0cf0f13ce">More...</a><br /></td></tr>
<tr class="separator:a3f7e8ab49db7fa4b333430d0cf0f13ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d5f08c91c23991236734ecd2d4909cb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0d5f08c91c23991236734ecd2d4909cb"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_tcp_acceptor.html#a0d5f08c91c23991236734ecd2d4909cb">reopen</a> (void)</td></tr>
<tr class="memdesc:a0d5f08c91c23991236734ecd2d4909cb"><td class="mdescLeft">&#160;</td><td class="mdescRight">重新打开接收器 <br /></td></tr>
<tr class="separator:a0d5f08c91c23991236734ecd2d4909cb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1e55a3bc5b17b5960419afe981c4b3f7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1e55a3bc5b17b5960419afe981c4b3f7"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>close</b> (void)</td></tr>
<tr class="separator:a1e55a3bc5b17b5960419afe981c4b3f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9531ec6fecdb6afc545d2cd513dc535"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae9531ec6fecdb6afc545d2cd513dc535"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>shutdown</b> (void)</td></tr>
<tr class="separator:ae9531ec6fecdb6afc545d2cd513dc535"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad93eec19093d98d84aaa7f74486373f7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad93eec19093d98d84aaa7f74486373f7"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_tcp_acceptor.html#ad93eec19093d98d84aaa7f74486373f7">handleInput</a> (void)</td></tr>
<tr class="memdesc:ad93eec19093d98d84aaa7f74486373f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">处理输入 <br /></td></tr>
<tr class="separator:ad93eec19093d98d84aaa7f74486373f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c313189b9166036e374750ddc64ea97"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8c313189b9166036e374750ddc64ea97"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_tcp_acceptor.html#a8c313189b9166036e374750ddc64ea97">handleOutput</a> (void)</td></tr>
<tr class="memdesc:a8c313189b9166036e374750ddc64ea97"><td class="mdescLeft">&#160;</td><td class="mdescRight">处理输出 <br /></td></tr>
<tr class="separator:a8c313189b9166036e374750ddc64ea97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d97daf8df44b40efce078b3382f0ea5"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3d97daf8df44b40efce078b3382f0ea5"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_tcp_acceptor.html#a3d97daf8df44b40efce078b3382f0ea5">handleException</a> (void)</td></tr>
<tr class="memdesc:a3d97daf8df44b40efce078b3382f0ea5"><td class="mdescLeft">&#160;</td><td class="mdescRight">处理异常 <br /></td></tr>
<tr class="separator:a3d97daf8df44b40efce078b3382f0ea5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef1361f3392c7757cc0fc0a13b15163d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aef1361f3392c7757cc0fc0a13b15163d"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_tcp_acceptor.html#aef1361f3392c7757cc0fc0a13b15163d">handleClose</a> (void)</td></tr>
<tr class="memdesc:aef1361f3392c7757cc0fc0a13b15163d"><td class="mdescLeft">&#160;</td><td class="mdescRight">处理关闭(套接字从反应器移除) <br /></td></tr>
<tr class="separator:aef1361f3392c7757cc0fc0a13b15163d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0d160fee462b62035ad3fe1a641f4449"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a0d160fee462b62035ad3fe1a641f4449"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdev_1_1net_1_1_tcp_acceptor.html#a0d160fee462b62035ad3fe1a641f4449">handleHeartBeat</a> (void)</td></tr>
<tr class="memdesc:a0d160fee462b62035ad3fe1a641f4449"><td class="mdescLeft">&#160;</td><td class="mdescRight">处理心跳 <br /></td></tr>
<tr class="separator:a0d160fee462b62035ad3fe1a641f4449"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae41ca5857da0f0fe002a6030b81c8c29"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae41ca5857da0f0fe002a6030b81c8c29"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>setMakeConnectionCallbck</b> (RtnTcpConnectionPtrRefCB callback)</td></tr>
<tr class="separator:ae41ca5857da0f0fe002a6030b81c8c29"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab6dba62b674eff21a2e8c3f9c00223d9"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab6dba62b674eff21a2e8c3f9c00223d9"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>setConnectionEstablishedCallback</b> (PassTcpConnectionPtrRefCB callback)</td></tr>
<tr class="separator:ab6dba62b674eff21a2e8c3f9c00223d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3533da8d23f611f9de8a40287333a2ed"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3533da8d23f611f9de8a40287333a2ed"></a>
<a class="el" href="classdev_1_1net_1_1_socket.html">Socket</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>getSocket</b> (void)</td></tr>
<tr class="separator:a3533da8d23f611f9de8a40287333a2ed"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a3ecf3132e8c4bf890c07853cfab7619c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3ecf3132e8c4bf890c07853cfab7619c"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>TcpServer</b></td></tr>
<tr class="separator:a3ecf3132e8c4bf890c07853cfab7619c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Tcp连接接收器 </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a3f7e8ab49db7fa4b333430d0cf0f13ce"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool TcpAcceptor::open </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>addr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>backlog</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>打开接收器 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">addr</td><td>监听地址 </td></tr>
    <tr><td class="paramname">port</td><td>监听端口 </td></tr>
    <tr><td class="paramname">backlog</td><td>接收队列长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>bool </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>dev/dev/net/<a class="el" href="_tcp_acceptor_8hpp_source.html">TcpAcceptor.hpp</a></li>
<li>dev/src/net/TcpAcceptor.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>dev</b></li><li class="navelem"><b>net</b></li><li class="navelem"><a class="el" href="classdev_1_1net_1_1_tcp_acceptor.html">TcpAcceptor</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.10 </li>
  </ul>
</div>
</body>
</html>
